<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function fun(num,str,ber){
            switch(str){
                case "+":return num+ber;break;
                case "-":return num-ber;break;
                case "*":return num*ber;break;
                case "/":return num/ber;break;
                default:return "请输入正确的"
            }
        }
        console.log(fun(10,"*",10))
    </script>
</body>
</html>